package com.wyx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wyx.mapper.UserMapper;
import com.wyx.domain.User;
import com.wyx.service.UserService;
/**
 * @author  xiaoxiong
 * @date  2021/2/24 19:17
 * @version 1.0
 */
@Service
public class UserServiceImpl  implements UserService{

    @Autowired
    private UserMapper userMapper;

    @Override
    public User queryUserByPhone(String phone) {
        QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
        QueryWrapper<User> eq = userQueryWrapper.eq(User.COL_PHONE, phone);
        return this.userMapper.selectOne(eq);
    }


    @Override
    public User getOne(Long userId) {
        return this.userMapper.selectById(userId);
    }
}
